<template>
	<Form label-position="top">
        <FormItem label="是否启用">
            <RadioGroup v-model="value.type">
		        <Radio :label="1">启用</Radio>
		        <Radio :label="0">禁用</Radio>
		    </RadioGroup>
        </FormItem>
        <FormItem label="进入方式">
            <RadioGroup v-model="value.enter">
		        <Radio :label="0">定时关闭</Radio>
		        <Radio :label="1">点击进入</Radio>
		    </RadioGroup>
        </FormItem>
        <FormItem label="关闭时间" v-if="value.enter == 0">
            <RadioGroup v-model="value.time">
		        <Radio :label="2">2秒</Radio>
		        <Radio :label="4">4秒</Radio>
		        <Radio :label="5">5秒</Radio>
		    </RadioGroup>
        </FormItem>
        <FormItem label="上传图片">
        	<div class="ui-start-upload">
        		<span class="ui-start-tip">{{value.enter == 0 ? value.time + 's 跳过' : '点击关闭'}}</span>
        		<ImageUpload v-model="value.img" style="z-index: 1;"></ImageUpload>
        	</div>
        </FormItem>
   	</Form>
</template>

<script>
import ImageUpload from '@/views/diy/components/ImageUpload.vue';
export default {
	name: 'startPageConfig',
	components: {
		ImageUpload
	},
	props: {
		value: {
			type: Object,
			default: function() {
				return {};
			}
		}
	}
}
</script>

<style>
.ui-start-upload {
	position: relative;
	width: 280px;
	height: 430px;
	border: 1px solid #eee;
	background-color: #f6f6f6;
}
.ui-start-upload .ui-start-tip {
	position: absolute;
	top: 20px;
	right: 20px;
	padding: 0 10px;
	color: #fff;
	font-size: 12px;
	line-height: 26px;
	border-radius: 4px;
	text-align: center;
	background-color: #646464;
}
</style>